home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / cmds / rpn.man < prev    next >
Encoding:
Text File  |  1989-06-07  |  4.9 KB  |  223 lines

  1. ' Copyright 1989 Regents of the University of California
  2. ' Permission to use, copy, modify, and distribute this
  3. ' documentation for any purpose and without fee is hereby
  4. ' granted, provided that this notice appears in all copies.
  5. ' The University of California makes no representations about
  6. ' the suitability of this material for any purpose.  It is
  7. ' provided "as is" without express or implied warranty.
  8. ' $Header: /sprite/lib/forms/RCS/proto.man,v 1.3 119/01/09 11:43:01 ouster Exp $ SPRITE (Berkeley)
  9. .so \*(]ltmac.sprite
  10. .HS RPN cmds
  11. .BS
  12. .SH NAME
  13. rpn \- reverse polish notation visual desk calculator
  14. .SH SYNOPSIS
  15. .nf
  16. \fBrpn\fR
  17. .BE
  18.  
  19. .SH DESCRIPTION
  20. .PP
  21. \fBRpn\fP is a stack-based desk calculator with a screen-oriented front end.
  22. This calculator is very similar, in many respects, to old
  23. Hewlett-Packard scientific calculators.
  24. The available commands are listed in a menu at the top of the
  25. screen.
  26. the first few elements of its computation stack are listed next.
  27. At the bottom of the screen is a data entry area.
  28. \fBRpn\fP uses ``reverse polish notation'', or stack-oriented commands.
  29. Thus the basic syntax is
  30. .DS
  31. \fIarg\fR \fIarg\fR \fIop\fR
  32. For example: 47 358 +
  33. .DE
  34. .PP
  35. This command pushes two values on the stack (47 and 358),
  36. then applies the operation (+) to those two values.
  37. Operands are popped from the stack and replaced by the result of the operation.
  38. Items can be pushed onto the stack one at a time,
  39. or more complicated expressions can be entered all on one line:
  40. .DS
  41. For example: 47 179 2 * +
  42. or: 47 179 * 2 +
  43. .DE
  44. .PP
  45. Note that the previous two examples are different and produce different
  46. answers.
  47. .SH "ARITHMETIC OPERATIONS"
  48. .IP + 11
  49. Addition
  50. .IP - 11
  51. Subtraction
  52. .IP * 11
  53. Multiplication
  54. .IP / 11
  55. Division
  56. .IP mod 11
  57. Modulo
  58. .IP ** 11
  59. Exponentiation
  60. .IP +- 11
  61. Negation
  62. .IP 1/x 11
  63. Inverse
  64. .IP min 11
  65. Minimum of two arguments
  66. .IP max 11
  67. Maximum of two arguments
  68. .IP abs 11
  69. Absolute value
  70. .IP maxuint 11
  71. Generates the maximum unsigned integer
  72. .IP maxint 11
  73. Generates the maximum signed integer
  74. .SH "LOGICAL OPERATIONS"
  75. .IP "and (&)" 11
  76. .IP "or (|)" 11
  77. .IP "xor (^)" 11
  78. .IP "not (~)" 11
  79. .IP "shr (>>)" 11
  80. Shift right
  81. .IP "shl (<<)" 11
  82. Shift left
  83. .SH "STACK OPERATIONS"
  84. .IP xy 11
  85. Swap top two stack elements
  86. .IP copy 11
  87. Pushes a copy of the top of stack
  88. .IP clrx 11
  89. Clear x, the top of the stack
  90. .IP y 11
  91. Clear y, the next to top of the stack
  92. .IP clrs 11
  93. Clear the whole stack
  94. .IP "clrm \fIN\fP" 11
  95. Clear register number N
  96. .IP "sto \fIN\fP" 11
  97. Store to register number N
  98. .IP "sto+ \fIN\fP" 11
  99. Add to register number N
  100. .IP "sto- \fIN\fP" 11
  101. Subtract from register number N
  102. .IP "rcl \fIN\fP" 11
  103. Recall register number N to top of stack
  104. .IP "disp \fID\fP" 11
  105. Display D places before decimal point.
  106. Rpn uses exponential notation if a number can't be display in this field width.
  107. .IP oct 11
  108. Display stack in octal
  109. .IP nooct 11
  110. Remove octal stack display
  111. .IP hex 11
  112. Display stack in hexadecimal
  113. .IP nohex 11
  114. Remove hexadecimal stack display
  115. .IP signed 11
  116. (unknown function)
  117. .IP unsigned 11
  118. (unknown function)
  119. .IP deg 11
  120. Degree mode
  121. .IP rad 11
  122. Radian mode
  123. .SH "TRIG FUNCTIONS"
  124. .IP sin 11
  125. Sine
  126. .IP cos 11
  127. Cosine
  128. .IP tan 11
  129. Tangent
  130. .IP sinh 11
  131. Hyperbolic sine
  132. .IP cosh 11
  133. Hyperbolic cosine
  134. .IP tanh 11
  135. Hyperbolic tangent
  136. .IP asin 11
  137. Arcsine
  138. .IP acos 11
  139. Arccosine
  140. .IP atan 11
  141. Arctangent
  142. .IP asnh 11
  143. Arc-hyperbolic sine
  144. .IP acnh 11
  145. Arc-hyperbolic cosine
  146. .IP atnh 11
  147. Arc-hyperbolic tangent
  148. .IP pi 11
  149. Generate the constant pi
  150. .SH "LOGARITHMIC FUNCTIONS"
  151. .IP "ln" 11
  152. Natural log
  153. .IP "log" 11
  154. Base-10 log
  155. .IP "lg2" 11
  156. Base-2 log
  157. .IP exp 11
  158. Exponential
  159. .IP alog 11
  160. Base-10 exponential
  161. .IP alg2 11
  162. Base-2 exponential
  163. .SH "STATISTICAL FUNCTIONS"
  164. .IP s+ 11
  165. Statistical accumulation.
  166. This accumulates statistical data on two variables, X and Y, into numbered
  167. registers.  The functions var, sd and rms use this data.  Given a
  168. series of n correlated X and Y pairs, enter each pair in the x and y
  169. registers, and execute s+.  The data is accumulated as follows:
  170. .DS
  171. sto 10        n
  172. sto 9        sum XY
  173. sto 8        sum Y**2
  174. sto 7        sum Y
  175. sto 6        sum X**2
  176. sto 5        sum X
  177. .DE
  178. .IP s- 11
  179. This is the inverse of s+ and is used to remove incorrectly entered X-Y pairs.
  180. .IP var 11
  181. The variance of X and Y is computed in registers x and y,
  182. and also in registers 3 and 4.
  183. .IP sd 11
  184. Standard deviation of X and Y is computed in registers x and y,
  185. and also in registers 3 and 4.
  186. .IP rms 11
  187. Root-mean squared of X and Y is computed in registers x and y,
  188. and also in registers 3 and 4.
  189. .SH "MISCELLANEOUS FUNCTIONS"
  190. .IP sqrt 11
  191. Square root
  192. .IP gcdv 11
  193. Greatest common divisor
  194. .IP comb 11
  195. Combinatorial ??
  196. .IP fact 11
  197. Factorial
  198. .IP lrgn 11
  199. Lagrange ??
  200. .IP trun 11
  201. Truncate
  202. .IP roun 11
  203. Round
  204. .IP rand 11
  205. Generate a random number
  206. .SH "CONVERSION FUNCTIONS"
  207. .IP d-r 11
  208. Degrees to radians
  209. .IP r-d 11
  210. Radians to degrees
  211. .IP r-p 11
  212. Rectangular to polar (two dimensions)
  213. .IP p-r 11
  214. Polar to rectangular
  215. .IP r-s 11
  216. Rectangular to spherical (three dimensions)
  217. .IP s-r 11
  218. Spherical to rectangular
  219. .SH KEYWORDS
  220. calculator, stack, reverse polish notation
  221.